<?php

$table='bannerplug';
if(mysql_num_rows(mysql_query("SHOW TABLES LIKE '".$table."'"))==1) {
    header("Location: home.php?page=pluginview&p=$_GET[p]&root=add_module.php");
}
else {
// Create table

mysql_select_db($database_konek, $konek);
$query_add = "CREATE TABLE bannerplug(
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`judul` VARCHAR( 255 ) NOT NULL ,
`width` INT( 3 ) NOT NULL ,
`height` INT( 3 ) NOT NULL 
)";
$add = mysql_query($query_add, $konek) or die(mysql_error());

mysql_select_db($database_konek, $konek);
$query_add2 = "CREATE TABLE bannerplug_data(
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`id_module` INT( 3 ) NOT NULL ,
`image` VARCHAR( 255 ) NOT NULL ,
`nama` VARCHAR( 255 ) NOT NULL ,
`deskripsi` VARCHAR( 255 ) NOT NULL 
)";
$add2 = mysql_query($query_add2, $konek) or die(mysql_error());
header("Location: home.php?page=pluginview&p=$_GET[p]&root=add_module.php");
	
}

?>
